<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="../language.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="i18n.userCenter"/>-<fmt:message key="i18n.title"/></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link href="../skin/skin1/css/css.css" rel="stylesheet">
<script src="../skin/skin1/js/js.js"></script>
<script src="../skin/skin1/js/jquery.min.js"></script>
<script type="text/javascript" src="../scripts/user/common.js"></script>
<script type="text/javascript" src="../scripts/user/reguser.js"></script>
<script type="text/javascript">
function setLanguage(lang) {
	setCookie('language', lang, 300);
	window.top.location.reload();
}
function logout() {
	if (confirm("确定退出吗?")) {
		window.top.location.href = 'logout.jsp';
	}
}
function setCookie(c_name, value, exdays) {

	var exdate = new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value = escape(value)
			+ ((exdays == null) ? "" : "; expires="
					+ exdate.toUTCString());
	document.cookie = c_name + "=" + c_value;
}
</script>
</head>
<body style="background:#fff;">
  <div class="account">
    <div class="top">
    	<a class="left_first" href="javascript:;">&nbsp;</a>
		<a href="javascript:;"> <fmt:message key="i18n.huanYingYou" />：${loginName }</a>
		<a href="javascript:;" onclick="logout()">【<fmt:message key="i18n.anquantuichu" />】</a>
	</div>
    <div class="left">
    </div>
    <div class="right">
     <div id="registerMainContent" style="">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> <th scope="col" style="color:red;font-weight: 700;">您的资料尚未完善，请先完善后进行再其他操作</th> </tr>
        <tr>
          <td class="bdxx">
    		<form action="registerUser!saveRegisterInfo.action" method="post" id="registerInfo_form">
            	<input type="hidden" name="registerUserDTO.registerLocation" id="registerLocation" value="aArea" />
            	
     			
            	<label id="tips_text" class="topTips">&nbsp;</label>
            	
            	<p>
            		<span><fmt:message key="i18n.userRegAccount"/>：</span>
            		<input type="text" value="${loginName }" id="reg_loginName" readonly="readonly" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	
            	
            	<p>
            		<span><fmt:message key="i18n.userlevel"/>：</span>
            		<select class="srk" name="registerUserDTO.registerLevel">
   							<option value="L1"><fmt:message key="L1" />(3000)</option>
   							<option value="L2"><fmt:message key="L2" />(5000)</option>
   							<option value="L3"><fmt:message key="L3" />(10000)</option>
   							<option value="L4"><fmt:message key="L4" />(20000)</option>
   							<%-- <option value="L5"><fmt:message key="L5" />(20000)</option> --%>
   							<%-- <option value="L6"><fmt:message key="L6" />(不可购买)</option> --%>
   							<%--<option value="L7"><fmt:message key="L7" /></option>
   							<option value="L8"><fmt:message key="L8" /></option> --%>
   						</select>
   						&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	
            	<p>
            		<span><fmt:message key="i18n.piUserName"/>：</span>
            		<input type="text" value="${userEntity.userName }" name="registerUserDTO.userName" id="reg_userName" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText"><fmt:message key="i18n.userNameAndBankNameTips"/></label>
            	</p>
            	<%-- 
            	<p>
            		<span><fmt:message key="i18n.loginPassword"/>：</span>
            		<input type="password" value="" id="reg_password1" name="registerUserDTO.password1" placeholder="如不修改密码此处可不填" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	<p>
            		<span><fmt:message key="i18n.cofimLoginPassword"/>：</span>
            		<input type="password" value="" id="reg_conf_password1" placeholder="如不修改密码此处可不填" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	--%>
            	<p>
            		<span><fmt:message key="i18n.send2Password"/>：</span>
            		<input type="password" value="" id="reg_password2" name="registerUserDTO.password2" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	<p>
            		<span><fmt:message key="i18n.cofimsend2Password"/>：</span>
            		<input type="password" value="" id="reg_conf_password2" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText"></label>
            	</p>
            	<p>
            		<span><fmt:message key="i18n.recommendUser"/>：</span>
            		<input type="text" class="srk" name="registerUserDTO.recommendUser" id="reg_recommendUser" value="${userEntity.recommendUser }" 
            			onBlur="findUserNameByLoginName(this.value,'reg_show_recommendUser')">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText" id="reg_show_recommendUser">&nbsp;</label>
            	</p>
            	
     					
     			<%-- <p>
            		<span><fmt:message key="position"/>：</span>
            		<fmt:message key="i18n.left" />：<input type="radio" name="registerUserDTO.registerLocation1" id="registerLocation_aArea"  checked="checked" value="aArea" />
					<fmt:message key="i18n.right" />：<input type="radio" name="registerUserDTO.registerLocation1" id="registerLocation_bArea"  <c:if test="${registerLocation eq 'bArea' }"> checked="checked" </c:if> value="bArea" />

					&nbsp;<label class="tip"></label>
            		<label class="tip tipText" id="">&nbsp;</label>
            	</p>		
     					
            	<p>
            		<span><fmt:message key="contactuser"/>：</span>
            		<input type="text" class="srk" name="registerUserDTO.contactNo" id="reg_contactNo" value="${contactNo}" onBlur="findUserNameByLoginName(this.value,'reg_show_contactNo')">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText" id="reg_show_contactNo">&nbsp;</label>
            	</p>
            	
            	<p>
            		<span><fmt:message key="i18n.bdCenter"/>：</span>
            		<input class="srk" type="text" name="registerUserDTO.declarationCenters"  value="${userEntity.declarationCenters}" id="reg_declarationCenters" 
            			onBlur="findUserNameByLoginName(this.value,'reg_show_userName')">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText" id="reg_show_userName">&nbsp;</label>
            	</p> --%>
            	
            	<p><span><fmt:message key="i18n.openUserBank"/>：</span>
            		<select class="srk" id="accountType" name="registerUserDTO.accountType">
						<%-- <option value="">--<fmt:message key="i18n.pelaseSelect"/>--</option> --%>
						<option value="中国农业银行"><fmt:message key="i18n.abcBank"/></option>
						<option value="中国工商银行"><fmt:message key="i18n.gongBank"/></option>
						<option value="中国建设银行"><fmt:message key="i18n.ccbBank"/></option>
						<option value="中国银行"><fmt:message key="i18n.chinaBank"/></option>
						<option value="财付通"><fmt:message key="i18n.caifutong"/></option>
						<option value="支付宝">支付宝</option>
					</select>&nbsp;<label class="tip">*</label>
					<%-- <label class="tip tipText"> <fmt:message key="i18n.top002" /> </label> --%>
				</p>
				<p>
            		<span><fmt:message key="i18n.piBrankAccount"/>：</span>
            		<input type="text" id="reg_bankAccount" value="${userEntity.bankAccount }" name="registerUserDTO.bankAccount" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	<p>
            		<span><fmt:message key="i18n.openBankAddress"/>：</span>
            		<input type="text" value="${userEntity.openBankAddress }" id="openBankAddress" name="registerUserDTO.openBankAddress" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	<p>
            		<span><fmt:message key="i18n.piMobile"/>：</span>
            		<input id="reg_phone" type="text" readonly="readonly" value="${userEntity.mobile }" name="registerUserDTO.mobile" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	<%-- 
            	<p>
            		<span><fmt:message key="i18n.piEmail"/>：</span>
            		<input type="text" value="${userEntity.email }" name="registerUserDTO.email" id="reg_email" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText">&nbsp;</label>
            	</p>
            	<p><span><fmt:message key="i18n.ptype"/>：</span>
            		<select class="srk" id="regInfoProblem" name="registerUserDTO.passwordProblem" >
                    	<jsp:include page="PwdProblem.jsp"></jsp:include>
					</select>&nbsp;<label class="tip">*</label>
					<label class="tip tipText">&nbsp;</label>
				</p> --%>
				<%-- <p>
            		<span><fmt:message key="i18n.answer"/>：</span>
            		<input type="text" id="reg_passwordAnswer" value="${userEntity.passwordAnswer }" name="registerUserDTO.passwordAnswer" class="srk">&nbsp;<label class="tip">*</label>
            		<label class="tip tipText"><fmt:message key="i18n.rememberSecretSecurity"/></label>
            	</p> --%>
            	<p><input type="button" class="tj" value="<fmt:message key="i18n.save"/>" id="btnSubmitInfo"></p>
            </form>
          </td>
        </tr>
      </table>
    </div>
  </div>
</div>
<script type="text/javascript">
$(function(){
	//$('#registerMainContent').css("margin-left","200px");
	var problem = "${userEntity.passwordProblem}";
	var bank = "${userEntity.accountType}";
	//$('#accountType').val(bank);
	//$('#regInfoProblem').val(problem);
	//$('#reg_registerLocation').val('${param.registerLocation}');
	//randomNo('reg_loginName');
	document.onkeydown = function(evt){
		var evt = window.event?window.event:evt;
		if(evt.keyCode==13){
			//regSubmit();
		}
	}
	$("#register_form select[name='registerUserDTO.registerLevel']").change(function(){
		if($(this).val()==='L6'){
			alert("Landgrave card is not available for purchase, please choose another level!\n伯爵卡暂不可购买，请选择其他级别！")
			$(this).val('L1');
		}
	});
	
	$('#registerLocation_aArea,#registerLocation_bArea').click(function(){
		$('#registerLocation').val(this.value);
		//$('#reg_contactNo').val('');
		///alert('区位变更,请重新选择接点人!');
	});
	
	
	$('#reg_recommendUser').bind('blur',function(){
		$('#reg_contactNo').val('');
	});
	if( "${param.src}" === "unfinished"){
		var tips = '您的资料尚未完善，请先完善后进行再其他操作';
		//$("#tips_text").text( tips );
	}
	$("#btnSubmitInfo").click(function(){
		if( submitCheck() ){
			//alert('OK');
			var _frm = $('#registerInfo_form').serialize();
			 $.post('registerUser!saveRegisterUserAuth.action',_frm,function(res){
				 if(res=='success'){
					 $("#registerInfo_form").submit();
				 }else{
					 if(res=='loginNameExist')
						 alert('会员编号已存在!');
					 if(res=='recommendUserNotExist')
						 alert('推荐人编号不存在!');
					 if(res=='RecommendUserNotActivation')
						 alert('推荐人未激活，不允许推荐注册!');
					 if(res=='contactNoNotExist')
						 alert('接点人编号不存在!');
					 if(res=='contactNoNotActivation')
						 alert('接点人未激活，不允许注册下一层会员!');
					 if(res=='declarationCenterUserNotExist')
						 alert('运营中心不存在!');
					 if(res=='ABCAreaFull')
						 alert('左右区已满!');
					 if(res=='aAreaExist')
						 alert('左区已注册!');
					 if(res=='bAreaExist')
						 alert('右区已注册!');
					 if(res=='aAreaNotExistNotAllowRegBArea')
						 alert('左区未注册，右区不允许注册!');
					 if(res=='cAreaExist')
						 alert('C区已注册!');
					 if(res=='abAreaNotExistNotAllowRegCArea')
						 alert('AB区未注册满，还不能注册C区!');
					 if(res=='cAreaOnlyAllowsOneselfReg')
						 alert('C区只能由自己注册!');
					 if(res=='MyNotRecommedLeftArea')
						 alert('先注册左区并开通才允许注册!');
					 if(res=='staticMoneyNotEnough')
						 alert('注册失败，子账户余额不足!');
				 }
			 });
		}
	});
});	


</script>
</body>
</html>